home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat2 / standard / send.z / send
Encoding:
Text File  |  1998-10-20  |  6.3 KB  |  131 lines

  1.  
  2.  
  3.  
  4. SSSSEEEENNNNDDDD((((2222))))                                                                SSSSEEEENNNNDDDD((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      send, sendto, sendmsg - send a message from a socket
  10.  
  11. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ssssoooocccckkkkeeeetttt....hhhh>>>>
  14.      iiiinnnntttt sssseeeennnndddd((((iiiinnnntttt ssss,,,, ccccoooonnnnsssstttt vvvvooooiiiidddd ****mmmmssssgggg,,,, iiiinnnntttt lllleeeennnn,,,, iiiinnnntttt ffffllllaaaaggggssss))));;;;
  15.      iiiinnnntttt sssseeeennnnddddttttoooo((((iiiinnnntttt ssss,,,, ccccoooonnnnsssstttt vvvvooooiiiidddd ****mmmmssssgggg,,,, iiiinnnntttt lllleeeennnn,,,, iiiinnnntttt ffffllllaaaaggggssss,,,,
  16.                ssssttttrrrruuuucccctttt ssssoooocccckkkkaaaaddddddddrrrr ****ttttoooo,,,, iiiinnnntttt ttttoooolllleeeennnn))));;;;
  17.      iiiinnnntttt sssseeeennnnddddmmmmssssgggg((((iiiinnnntttt ssss,,,, ccccoooonnnnsssstttt ssssttttrrrruuuucccctttt mmmmssssgggghhhhddddrrrr ****mmmmssssgggg,,,, iiiinnnntttt ffffllllaaaaggggssss))));;;;
  18.  
  19. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  20.      _S_e_n_d, _s_e_n_d_t_o, and _s_e_n_d_m_s_g are used to transmit a message to another
  21.      socket.  _S_e_n_d may be used only when the socket is in a _c_o_n_n_e_c_t_e_d state,
  22.      while _s_e_n_d_t_o and _s_e_n_d_m_s_g may be used when the socket is unconnected.
  23.  
  24.      The address of the target is given by _t_o with _t_o_l_e_n specifying its size.
  25.      The length of the message is given by _l_e_n.  If the message is too long to
  26.      pass atomically through the underlying protocol, then the error EMSGSIZE
  27.      is returned, and the message is not transmitted.
  28.  
  29.      Usually no indication of failure to deliver is implicit in a _s_e_n_d.
  30.      Return values of -1 indicate some locally detected errors.  Connected
  31.      datagram sockets may receive error indications from a previous _s_e_n_d.
  32.  
  33.      If no messages space is available at the socket to hold the message to be
  34.      transmitted, then _s_e_n_d normally blocks, unless the socket has been placed
  35.      in non-blocking I/O mode.  The _s_e_l_e_c_t(2) call may be used to determine
  36.      when it is possible to send more data.
  37.  
  38.      The _f_l_a_g_s parameter may include one or more of the following:
  39.  
  40.      #define   MSG_OOB        0x1  /* process out-of-band data */
  41.      #define   MSG_DONTROUTE  0x4  /* bypass routing,
  42.                               use direct interface */
  43.  
  44.  
  45.      The flag MSG_OOB is used to send "out-of-band" data on sockets that
  46.      support this notion (e.g., SOCK_STREAM); the underlying protocol must
  47.      also support "out-of-band" data.  MSG_DONTROUTE is usually used only by
  48.      diagnostic or routing programs.
  49.  
  50.      See _r_e_c_v(2) for a description of the _m_s_g_h_d_r structure.
  51.  
  52. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  53.      The call returns the number of characters sent, or -1 if an error
  54.      occurred.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.                                                                         PPPPaaaaggggeeee 1111
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. SSSSEEEENNNNDDDD((((2222))))                                                                SSSSEEEENNNNDDDD((((2222))))
  68.  
  69.  
  70.  
  71. EEEERRRRRRRROOOORRRRSSSS
  72.      [EBADF]             An invalid descriptor was specified.
  73.  
  74.      [ENOTSOCK]          The argument _s is not a socket.
  75.  
  76.      [EFAULT]            An invalid user space address was specified for a
  77.                          parameter.
  78.  
  79.      [EMSGSIZE]          The socket requires that message be sent atomically,
  80.                          and the size of the message to be sent made this
  81.                          impossible.
  82.  
  83.      [EWOULDBLOCK]       The socket is marked non-blocking and the requested
  84.                          operation would block.
  85.  
  86.      [ENOBUFS]           The system was unable to allocate an internal buffer.
  87.                          The operation may succeed when buffers become
  88.                          available.
  89.  
  90.      [ENOBUFS]           The output queue for a network interface was full.
  91.                          This generally indicates that the interface has
  92.                          stopped sending, but may be caused by transient
  93.                          congestion.
  94.  
  95.      [ECONNREFUSED]      The remote port was invalid when using the _s_e_n_d call
  96.                          on a connected datagram socket.
  97.  
  98.      [EISCONN]           A _s_e_n_d_t_o or _s_e_n_d_m_s_g call was used on a connected
  99.                          socket.
  100.  
  101.      [EACCES]            The requested operation specified a broadcast address
  102.                          as the destination but the SO_BROADCAST socket option
  103.                          was not enabled (see _s_e_t_s_o_c_k_o_p_t(2)).
  104.  
  105.      [EHOSTUNREACH]      The remote host was unreachable via the network.
  106.  
  107.      [ENETUNREACH]       The remote network is unknown to the routing system.
  108.  
  109.      [EHOSTDOWN]         The remote host was determined to be down, possibly
  110.                          due to a failure to resolve its MAC-level address
  111.                          (see _a_r_p(7P)).
  112.  
  113. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  114.      fcntl(2), recv(2), select(2), getsockopt(2), socket(2), write(2)
  115.  
  116. NNNNOOOOTTTTEEEE
  117.      ABI-compliant versions of the above call can be obtained from
  118.      _l_i_b_s_o_c_k_e_t._s_o.
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.                                                                         PPPPaaaaggggeeee 2222
  127.  
  128.  
  129.  
  130.